```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AQS - Java并发编程核心组件</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb 0%, #4a6cf7 100%);
        }
        .card {
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        }
        .highlight {
            position: relative;
        }
        .highlight::before {
            content: '';
            position: absolute;
            left: -4px;
            top: 0;
            height: 100%;
            width: 4px;
            background: #4a6cf7;
            border-radius: 2px;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 3.5rem;
            line-height: 1;
            margin: 0 0.5rem 0 0;
            color: #4a6cf7;
            font-weight: bold;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <div class="hero text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 leading-tight">AQS</h1>
                    <p class="text-xl md:text-2xl mb-6 opacity-90">Java并发编程的核心组件</p>
                    <p class="text-lg mb-8 opacity-80">AbstractQueuedSynchronizer是构建Java并发工具的基础框架，支撑了ReentrantLock、Semaphore等核心类</p>
                    <div class="flex space-x-4">
                        <a href="#concepts" class="bg-white text-blue-600 px-6 py-3 rounded-lg font-medium hover:bg-blue-50 transition duration-300 inline-flex items-center">
                            <i class="fas fa-book-open mr-2"></i> 核心概念
                        </a>
                        <a href="#structure" class="border-2 border-white text-white px-6 py-3 rounded-lg font-medium hover:bg-white hover:text-blue-600 transition duration-300 inline-flex items-center">
                            <i class="fas fa-project-diagram mr-2"></i> 工作原理
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <div class="bg-white bg-opacity-10 p-6 rounded-xl border border-white border-opacity-20 backdrop-filter backdrop-blur-sm">
                        <div class="mermaid">
                            graph TD
                                A[AQS] --> B[ReentrantLock]
                                A --> C[Semaphore]
                                A --> D[CountDownLatch]
                                A --> E[ReadWriteLock]
                                B --> F[独占模式]
                                C --> G[共享模式]
                                D --> G
                                E --> F & G
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content -->
    <div class="container mx-auto max-w-6xl px-4 py-16">
        <section id="overview" class="mb-20">
            <div class="flex justify-center mb-12">
                <div class="text-center max-w-3xl">
                    <h2 class="text-3xl font-bold mb-4">AQS概述</h2>
                    <div class="w-20 h-1 bg-blue-500 mx-auto mb-6"></div>
                    <p class="text-lg text-gray-600">
                        AbstractQueuedSynchronizer是Java并发编程中的一个核心组件，位于java.util.concurrent包中，
                        用于构建锁和同步器的基础框架。AQS通过FIFO等待队列实现了各种高级同步工具。
                    </p>
                </div>
            </div>
        </section>

        <section id="concepts" class="mb-20">
            <h2 class="text-2xl font-bold mb-8 flex items-center">
                <i class="fas fa-lightbulb text-blue-500 mr-3 text-xl"></i> AQS的基本概念
            </h2>
            <div class="grid md:grid-cols-2 gap-8">
                <div class="card bg-white p-6 rounded-xl">
                    <div class="flex items-center mb-4">
                        <div class="bg-blue-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-lock text-blue-500 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">独占模式</h3>
                    </div>
                    <p class="text-gray-600">
                        在这种模式下，只有一个线程能够获取资源，其他线程需要排队等待。例如，ReentrantLock就是使用了独占模式，
                        它允许一个线程多次获取同一把锁（可重入）。
                    </p>
                </div>
                <div class="card bg-white p-6 rounded-xl">
                    <div class="flex items-center mb-4">
                        <div class="bg-green-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-users text-green-500 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold">共享模式</h3>
                    </div>
                    <p class="text-gray-600">
                        在这种模式下，多个线程可以同时获取资源，例如Semaphore或ReadWriteLock的读锁就是使用了共享模式。
                        这种模式适用于允许并发访问的场景。
                    </p>
                </div>
            </div>
        </section>

        <section id="structure" class="mb-20">
            <h2 class="text-2xl font-bold mb-8 flex items-center">
                <i class="fas fa-sitemap text-blue-500 mr-3 text-xl"></i> AQS的核心结构
            </h2>
            <div class="grid md:grid-cols-3 gap-6">
                <div class="card bg-white p-6 rounded-xl">
                    <div class="flex justify-center mb-4">
                        <div class="bg-purple-100 p-3 rounded-lg">
                            <i class="fas fa-database text-purple-500 text-2xl"></i>
                        </div>
                    </div>
                    <h3 class="text-xl font-bold text-center mb-3">同步状态(State)</h3>
                    <p class="text-gray-600 text-center">
                        AQS内部维护了一个int类型的变量state，用来表示资源的状态。通过getState()、setState()和compareAndSetState()方法修改状态。
                    </p>
                </div>
                <div class="card bg-white p-6 rounded-xl">
                    <div class="flex justify-center mb-4">
                        <div class="bg-red-100 p-3 rounded-lg">
                            <i class="fas fa-list-ol text-red-500 text-2xl"></i>
                        </div>
                    </div>
                    <h3 class="text-xl font-bold text-center mb-3">FIFO等待队列</h3>
                    <p class="text-gray-600 text-center">
                        当线程获取资源失败时，AQS会将线程加入FIFO队列中。队列节点是内部类Node，代表等待线程，形成双向链表。
                    </p>
                </div>
                <div class="card bg-white p-6 rounded-xl">
                    <div class="flex justify-center mb-4">
                        <div class="bg-yellow-100 p-3 rounded-lg">
                            <i class="fas fa-puzzle-piece text-yellow-500 text-2xl"></i>
                        </div>
                    </div>
                    <h3 class="text-xl font-bold text-center mb-3">模板方法</h3>
                    <p class="text-gray-600 text-center">
                        AQS定义了tryAcquire、tryRelease等方法，由子类实现来定制具体行为。这是模板方法设计模式的典型应用。
                    </p>
                </div>
            </div>
        </section>

        <section id="workflow" class="mb-20">
            <h2 class="text-2xl font-bold mb-8">AQS工作原理</h2>
            <div class="bg-white rounded-xl overflow-hidden shadow-md">
                <div class="p-6">
                    <div class="mb-8">
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <span class="bg-blue-500 text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">1</span>
                            获取资源(Acquire)
                        </h3>
                        <div class="pl-11">
                            <p class="mb-4 highlight text-gray-700 pl-4 py-2">
                                线程调用acquire(int arg)方法尝试获取资源。内部会先调用tryAcquire(int arg)尝试获取。
                            </p>
                            <p class="mb-4 highlight text-gray-700 pl-4 py-2">
                                如果获取失败，线程会被封装成Node节点并加入等待队列尾部。
                            </p>
                            <p class="highlight text-gray-700 pl-4 py-2">
                                线程进入等待状态，直到被前驱节点唤醒后重新尝试获取资源。
                            </p>
                        </div>
                    </div>
                    <div>
                        <h3 class="text-xl font-bold mb-4 flex items-center">
                            <span class="bg-green-500 text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">2</span>
                            释放资源(Release)
                        </h3>
                        <div class="pl-11">
                            <p class="mb-4 highlight text-gray-700 pl-4 py-2">
                                线程调用release(int arg)方法释放资源。内部会调用tryRelease(int arg)释放资源并更新状态。
                            </p>
                            <p class="highlight text-gray-700 pl-4 py-2">
                                如果释放后发现有等待线程，会唤醒队列中的下一个线程，使其重新尝试获取资源。
                            </p>
                        </div>
                    </div>
                </div>
                <div class="bg-gray-50 p-6 border-t border-gray-200">
                    <div class="mermaid">
                        sequenceDiagram
                            participant T as Thread
                            participant A as AQS
                            T->>A: acquire(int arg)
                            A->>A: tryAcquire(arg)
                            alt 获取成功
                                A-->>T: 获取资源
                            else 获取失败
                                A->>A: 加入等待队列
                                A->>T: 进入等待
                                A->>T: 唤醒后重试
                            end
                    </div>
                </div>
            </div>
        </section>

        <section id="applications" class="mb-20">
            <h2 class="text-2xl font-bold mb-8 flex items-center">
                <i class="fas fa-cubes text-blue-500 mr-3 text-xl"></i> AQS的实际应用
            </h2>
            <div class="grid md:grid-cols-3 gap-6">
                <div class="card bg-white rounded-xl overflow-hidden">
                    <div class="bg-indigo-500 text-white p-4">
                        <h3 class="text-xl font-bold">ReentrantLock</h3>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-600 mb-4">
                            可重入的独占锁，使用AQS的独占模式实现。允许线程多次获取同一把锁，支持公平与非公平策略。
                        </p>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-indigo-100 text-indigo-800 text-xs px-2 py-1 rounded">独占模式</span>
                            <span class="bg-indigo-100 text-indigo-800 text-xs px-2 py-1 rounded">可重入</span>
                            <span class="bg-indigo-100 text-indigo-800 text-xs px-2 py-1 rounded">公平/非公平</span>
                        </div>
                    </div>
                </div>
                <div class="card bg-white rounded-xl overflow-hidden">
                    <div class="bg-teal-500 text-white p-4">
                        <h3 class="text-xl font-bold">Semaphore</h3>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-600 mb-4">
                            信号量，使用AQS的共享模式实现，控制同时访问特定资源的线程数量。可用于资源池限制等场景。
                        </p>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-teal-100 text-teal-800 text-xs px-2 py-1 rounded">共享模式</span>
                            <span class="bg-teal-100 text-teal-800 text-xs px-2 py-1 rounded">资源控制</span>
                            <span class="bg-teal-100 text-teal-800 text-xs px-2 py-1 rounded">可配置许可数</span>
                        </div>
                    </div>
                </div>
                <div class="card bg-white rounded-xl overflow-hidden">
                    <div class="bg-amber-500 text-white p-4">
                        <h3 class="text-xl font-bold">CountDownLatch</h3>
                    </div>
                    <div class="p-6">
                        <p class="text-gray-600 mb-4">
                            倒计时锁存器，使用AQS的共享模式实现。允许线程等待直到计数器减为零，常用于多线程同步。
                        </p>
                        <div class="flex flex-wrap gap-2">
                            <span class="bg-amber-100 text-amber-800 text-xs px-2 py-1 rounded">共享模式</span>
                            <span class="bg-amber-100 text-amber-800 text-xs px-2 py-1 rounded">线程同步</span>
                            <span class="bg-amber-100 text-amber-800 text-xs px-2 py-1 rounded">一次性使用</span>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <section id="summary" class="mb-20">
            <div class="bg-blue-50 border-l-4 border-blue-500 p-6 rounded-r-lg">
                <h2 class="text-2xl font-bold mb-4">总结</h2>
                <p class="drop-cap text-gray-700">
                    AbstractQueuedSynchronizer是Java并发包中众多同步工具的基础框架，通过其灵活的同步状态管理和高效的等待队列实现，为构建各种高级同步器提供了强大支持。理解AQS的工作原理对于深入掌握Java并发编程至关重要，能够帮助开发者更好地使用和定制同步工具以满足特定场景需求。
                </p>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-8">
        <div class="container mx-auto px-4">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">专业的编程技术分享平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition duration-300 inline-flex items-center">
                        <i class="fas fa-external-link-alt mr-2"></i> 访问技术小馆
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. All rights reserved.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            },
            sequence: {
                diagramMarginX: 50,
                diagramMarginY: 10,
                boxTextMargin: 5,
                useMaxWidth: true,
                rightAngles: false,
                showSequenceNumbers: false
            }
        });
    </script>
</body>
</html>
```